import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/components/cq-layout'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      { path: '/', redirect: '/index' },
      { path: '/index', component: () => import('@/views/home') },
      { path: '/about', component: () => import('@/views/about') },
      { path: '/case', component: () => import('@/views/case') },
      { path: '/apply', component: () => import('@/views/apply') },
      { path: '/news', component: () => import('@/views/news') },
      { path: '/detail/:id', component: () => import('@/views/detail') }
    ]
  },
  {
    path: '*',
    component: () => import('@/views/errPage')
  }
]

const router = new VueRouter({
  routes
})

export default router
